a={
   'name':"tom",
   'age':20,
   'height':165.21,
   'sex':None,
   'sister':'lily',
   '是否是三好学生': False,
   '爱好': {'文学': ['读书', '写字', '看电影', '画画'],'体育': ['跑步', '杠铃', '游泳']
    }
}
print(a)
import json
str1=json.dumps(a)
print(str1)
with open('a.txt', 'w', encoding='utf-8') as f:
    f.write(str1)
with open('a.txt', 'r', encoding='utf-8') as f1:
    b=f1.read()
c=json.loads(b)
print(type(c))
print(c)
